package com.cbs.module.friend.sample;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import com.cbs.application.activity.CBSActivity;


/**
 * Created by broche on 1/11/16.
 */
public class InputActivity extends CBSActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.input);
        setResult(Activity.RESULT_CANCELED);

        findViewById(R.id.submit).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent();
                intent.putExtra("input", ((EditText) findViewById(R.id.input)).getText().toString());
                intent.putExtra("id", getIntent().getIntExtra("id", -1));
                setResult(Activity.RESULT_OK, intent);
                finish();
            }
        });
    }
}
